package com.simon.hse.activity.safe.jobticket;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyApplyActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyApprovalQueryListActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyCancelApprovalQueryListActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyGangsishengActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyQueryListActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyQizhongjiActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyJobPlanActivity;
import com.simon.hse.activity.safe.workpermit.WorkPermitCancelQueryActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 一般吊装作业许可证管理
 */
@SuppressWarnings("all")
@ContentView(R.layout.activity_job_ticket_commonly)
public class JobTicketCommonlyManageActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;

    @ViewInject(R.id.iv_common_right)
    ImageView mIv_common_right;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mTv_common_title.setText("一般吊装作业许可证");
        mIv_common_right.setImageResource(R.mipmap.tab_add_icon);
    }

    @Event(value = {R.id.iv_common_left, R.id.iv_common_right})
    private void back(View view) {
        switch (view.getId()) {
            case R.id.iv_common_left:
                finish();
            case R.id.iv_common_right:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyApplyActivity.class));
                break;
        }
    }

    @Event(value = {R.id.ll_query, R.id.ll_approval, R.id.ll_cancel_query, R.id.ll_cancel_approval, R.id.ll_qizhongji, R.id.ll_gangsisheng, R.id.ll_job_plan})
    private void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_query:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyQueryListActivity.class));
                break;
            case R.id.ll_approval:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyApprovalQueryListActivity.class));
                break;
            case R.id.ll_cancel_query:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, WorkPermitCancelQueryActivity.class).putExtra("type","commonly"));
                break;
            case R.id.ll_cancel_approval:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyCancelApprovalQueryListActivity.class));
                break;
            case R.id.ll_qizhongji:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyQizhongjiActivity.class));
                break;
            case R.id.ll_gangsisheng:
                    startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyGangsishengActivity.class));
                break;
            case R.id.ll_job_plan:
                startActivity(new Intent(JobTicketCommonlyManageActivity.this, CommonlyJobPlanActivity.class));
                break;
        }
    }
}
